<template>
  <div class="wrapper">
    <!--suppress HtmlUnknownTarget -->
    <img class="img" alt="image" :src="errorImage" draggable="false"/>
    <div class="content">
      <span class="content1">
        It looks like you are lost
      </span>
      <span class="content2">
        Page Not Found
      </span>
      <xum-button class="btn" @click="toHome">
        Back To Home Page
      </xum-button>
    </div>
  </div>
</template>

<script>
import ImageGood1 from '@/assets/img/error1.jpg'
import ImageGood2 from '@/assets/img/error2.jpg'
import ImageGood3 from '@/assets/img/error3.jpg'
import XumButton from '@/components/general/XumButton'
export default {
  name: 'AppError404',
  components: { XumButton },
  data () {
    return {
      // 0,1,2
      index: Math.floor(Math.random() * 3),
      ImageGood1,
      ImageGood2,
      ImageGood3,
      ImageDefault: ImageGood1
    }
  },
  computed: {
    errorImage () {
      switch (this.index) {
        case 0:
          return this.ImageGood1
        case 1:
          return this.ImageGood2
        case 2:
          return this.ImageGood3
        default:
          return this.ImageDefault
      }
    }
  },
  methods: {
    toHome () {
      this.$router.push('/')
    }
  }
}
</script>

<style scoped lang="scss">

  .wrapper{
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    position: relative;
    user-select: none;

    .img{
      width: 100%;
      height: 100%;
      position: absolute;
      top: 0;
      left: 0;
    }

    .content{
      width: 500px;
      height: 200px;
      top: 230px;
      left: 230px;
      position: absolute;
      text-align: left;

      .content1, .content2{
        display: block;
        width: 100%;
        text-align: left;
      }

      .content1{
        color: #333333;
        font-size: 16px;
        font-family: 'Roboto Condensed', sans-serif;
      }

      .content2{
        font-weight: 700;
        margin-bottom: 13px;
        font-size: 60px;
        line-height: 80px;
        font-family: 'Roboto Condensed', sans-serif;
        color: #333333;
      }

    }

  }

</style>
